
var editImage = document.getElementById("editImage")
var addImage = document.getElementById("addImage")
var file;
function addItemImage(event){
    file = event.target.files[0] || event.dataTransfer.files[0] || this.file.files[0]
}
function doAdd(){
    editItemFunc();
    console.dir(file)
    console.log(file.name)
    var formData = new FormData()
    formData.append("file",file)


    $.ajax
    (
        {
            type:'POST',
            url:'http://localhost:8022/addImage',
            data: formData,
            processData:false,//数据不做处理
            contentType:false,//不需要设置content-type请求头
            cache:false,//上传文件无需缓存
            success: function (data)
            {
                //alert("上传图片成功")
            },
            error:function (errorMsg)
            {
                console.log("fail")
                console.log(errorMsg)
            },
        }
    )
}